﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;

namespace FriendControl
{
    /// <summary>
    /// UserControl1.xaml 的交互逻辑
    /// </summary>
    public partial class FriendHeadImageControl : UserControl
    {
        private String username;
        /// <summary>
        ///     用户名
        /// </summary>
        public String Username
        {
            get { return username; }
            set { username = value; }
        }
        private String headImagePath;
        /// <summary>
        ///     头像文件名
        /// </summary>
        public String HeadImagePath
        {
            get { return headImagePath; }
            set { headImagePath = value; }
        }

        public FriendHeadImageControl()
        {
            InitializeComponent();
        }

        public void Init()
        {
            this.TB_UserInfo.ToolTip = "用户信息 : " + this.username;
            this.Img_UserImage.Source = new BitmapImage(new Uri(Directory.GetCurrentDirectory() + "../../syshead/" + this.headImagePath + ".jpg"));
        }
    }
}
